Skip to content

Conversation

@Blaze-DSP
Copy link
Contributor

Description

Add ray-serve.extra-dependency.yaml example demonstrating how to install custom dependencies in RayService containers. The example shows:

  • Installing system packages and shared Python dependencies via container args
  • Installing application-specific Python dependencies via runtime_env

@Blaze-DSP Blaze-DSP force-pushed the feat/extra-dependency branch from de238a9 to 0654d28 Compare January 11, 2026 08:28
Comment on lines 44 to 50
resources:
limits:
cpu: 2
memory: 4Gi
requests:
cpu: 2
memory: 4Gi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing. Would you mind standardizing the double quoting style? You can refer to #4339 and #4359.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Plus the example config has been updated, since there were issues with prv one

Comment on lines +107 to +116
# Shared dependencies via args
# System packages and pip packages installed here are accessible
# to ALL applications in this RayService
args:
- |
sudo apt-get update && \
sudo apt-get install -y --no-install-recommends curl && \
sudo rm -rf /var/lib/apt/lists/* && \
pip install httpx \
# Make sure to add the \ at the end of the last line
Copy link
Member

@Future-Outlier Future-Outlier Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the PR!
Using args for dependency installation might be risky.
Since args executes first, if the installation takes > 10 mins, the liveness probe will fail and restart the Pod.
Would postStart be a better approach here?

Suggested change
# Shared dependencies via args
# System packages and pip packages installed here are accessible
# to ALL applications in this RayService
args:
- |
sudo apt-get update && \
sudo apt-get install -y --no-install-recommends curl && \
sudo rm -rf /var/lib/apt/lists/* && \
pip install httpx \
# Make sure to add the \ at the end of the last line
# Shared dependencies via lifecycle postStart hook
# System packages and pip packages installed here are accessible
# to ALL applications in this RayService
lifecycle:
postStart:
exec:
command:
- /bin/bash
- -c
- |
sudo apt-get update && \
sudo apt-get install -y --no-install-recommends curl && \
sudo rm -rf /var/lib/apt/lists/* && \
pip install httpx

Copy link
Contributor Author

@Blaze-DSP Blaze-DSP Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to do it before ray start, cz if it happens after ray and takes a long time, then the serving will fail incase, dependencies are not present when serve applications starts. I did try with bigger dependencies and it seemed to work for me.

ur thoughts on this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is a good idea because
when installation > 10 min, kubelet will restart the pod, and we will repeat it again and again

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @win5923 @seanlaii to take a look

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @rueian to discuss when you have time

Copy link
Member

@Future-Outlier Future-Outlier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should build a custom image instead, since this might cause other potential problem like here

cc @rueian

@Future-Outlier Future-Outlier moved this from to review to Done in @Future-Outlier's kuberay project Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants